using System;
using System.Collections.Generic;
using System.Text;

namespace Widgetsphere.Core.DataAccess
{
  public partial interface IPersistableDomainObject : IDomainObject
  {
    event EventHandler BeforeUpdate;
    event EventHandler AfterUpdate;
    event EventHandler BeforeInsert;
    event EventHandler AfterInsert;
    event EventHandler BeforeDelete;
    event EventHandler AfterDelete;

    void OnBeforeUpdate(object sender, System.EventArgs e);
    void OnAfterUpdate(object sender, System.EventArgs e);
    void OnBeforeInsert(object sender, System.EventArgs e);
    void OnAfterInsert(object sender, System.EventArgs e);
    void OnBeforeDelete(object sender, System.EventArgs e);
    void OnAfterDelete(object sender, System.EventArgs e);

    bool EventsEnabled { get;set;}    
    void Persist();

  }
}